#ifndef WIDGET_H
#define WIDGET_H

#include <QtGui>
#include <QTcpSocket>
#include <QUdpSocket>
#include "server.h"

namespace Ui {
    class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();
    QTcpSocket sendSocket;
    QTcpSocket receiveSocket;
    c_server tcpServer;
    QUdpSocket udpSocket;

private:
    Ui::Widget *ui;
    QMap<QString, QHostAddress> m_mapUsers;
    QMap<QString, QHostAddress> m_mapReceiver;
    QTextCodec* m_pCodecEUCKR;
    QString m_strMyName;
    quint16 m_uint16Port;

private slots:
    void msgSend();
    void msgReceive();
    void udpReceive();
    void udpRefresh();
    void udpResponse();
    void sendListAdd(QListWidgetItem*);
    void sendListRemove(QListWidgetItem*);
    void on_pushButton_3_clicked();
    void on_pushButton_4_clicked();
    void on_pushButton_5_clicked();
    void changeGroup();
};

#endif // WIDGET_H
